{config_load file="lang/$language/lang_$language.conf" section="checkout"}
<h1>{#heading_checkout#}</h1>

{if $error}
	<div class="headerError">{$error}</div>
{/if}

{if $CUSTOMERS_IP!=''} 
	<strong>{#text_ip#}</strong> <span class="inputRequirement"><strong>{$CUSTOMERS_IP}</strong></span>
{/if}

<div class="checkout_row">
{foreach from=$SORTING item=box}
{if $box=='modules'}
	<div class="checkout_shipping_modules">
    	<div class="checkout_title border_top_radius_6" onclick="slideInOrOut('shipping_modules')"><strong>{#title_shipping_modules#}</strong> <img id="loader_shipping_modules" src="{$tpl_path}img/ajaxload.gif" border="0" class="ajaxloader" width="16" height="16" style="display:none;vertical-align:middle; position:absolute; margin-left:4px;margin-top:1px;" /><div class="right" id="btn_shipping_modules">-</div></div>
        <div class="checkout_content border_bottom_radius_6" id="chkt_shipping_modules">
        	<div id="not_virtual_modules"{if $VIRTUAL == 1 || $FREE_SHIPPING == 1} style="display:none;"{/if}>
        	{$FORM_ACTION_SHIPPING_MODULES}
            <div id="shippings">
            {$SHIPPING_BLOCK}
            </div>
            {if $NO_SHIPPINGS == 1}
            <div>            
            {#text_no_shippings#}
            </div>
            {/if}
            {*if $NO_SHIPPINGS != 1}
            <div class="checkout_button{$ONE_SHIPPING}">{$BUTTON_SAVE_SHIPPING_MODULE}</div>
            {/if*}
            <div style="color: #CC0000; font-weight:bold;" id="shipping_module_error">&nbsp;</div>
            {$FORM_END}
            </div>
            <div id="virtual_modules" class="virtual"{if $VIRTUAL != 1} style="display:none;"{/if}>{$TEXT_VIRTUAL}</div>
            <div id="free_shipping_modules" class="virtual"{if $FREE_SHIPPING != 1} style="display:none;"{/if}>{$FREE_SHIPPING_DESCRIPTION}</div>
        </div>

    </div>
    <div class="checkout_payment_modules">
    	<div class="checkout_title border_top_radius_6" onclick="slideInOrOut('payment_modules')"><strong>{#title_payment_modules#}</strong> <img id="loader_payment_modules" src="{$tpl_path}img/ajaxload.gif" border="0" class="ajaxloader" width="16" height="16" style="display:none;	vertical-align:middle; position:absolute; margin-left:4px;margin-top:1px;" /><div class="right" id="btn_payment_modules">-</div></div>
        <div class="checkout_content border_bottom_radius_6" id="chkt_payment_modules">
                <div id="payment_modules"{if $GV_COVER=='true'} style="display:none"{/if}>
                {$FORM_ACTION_PAYMENT_MODULES}
                <div id="payments">
                {$PAYMENT_BLOCK}
                </div>
                {if $NO_PAYMENTS == 1}
                <div>
                {#text_no_payments#}
                </div>
                {/if}
                {if $NO_PAYMENTS != 1}
				<div class="checkout_button{$ONE_PAYMENT}">{$BUTTON_SAVE_PAYMENT_MODULE}</div>
				<br class="clearfix">
                {/if}
                <div class="inputRequirement left_space" id="payment_module_error">&nbsp;</div>
                {$FORM_END}
                </div>
                <div id="payment_gccover" class="virtual"{if $GV_COVER!='true'} style="display:none"{/if}>{#text_gccover#}</div>
                <div id="payment_gift">{$module_gift}</div>
				<div id="bonus">
	                {if $VALUED}  
	                <div id="payment_gift"><strong>{#TABLE_HEADING_REDEEM_SYSTEM#}</strong></div>
	                <div id="payment_gift">{#TEXT_REDEEM_SYSTEM_START#}{$VALUED}{#TEXT_REDEEM_SYSTEM_START_1#}{$ORDER_TOTAL}{$NOTE}</div>
	                <div id="payment_gift">{#TEXT_REDEEM_SYSTEM_SPENDING#} {$MAX_POINTS}{#TEXT_REDEEM_SYSTEM_SPENDING_1#} {$VALUED_MAX_POINTS}{#TEXT_REDEEM_SYSTEM_SPENDING_2#}</div>
	                <div id="payment_gift">{$LIMIT_EXACT_TRUE_MAX_POINTS}</div>
	                {/if}
	                {if $NOTE_NOT_ENOUGH_POINTS}
	                <div id="payment_gift">{#INFO_NOT_ENOUGH_POINTS#}</div>
	                {/if} 
	                {if $REFERRAL_INPUT}
	                <div id="payment_gift"><b>{$TABLE_HEADING_REFERRAL}</b></div>
	                <div id="payment_gift">{$TEXT_REFERRAL_REFERRED}</div>
	                <div id="payment_gift">{$REFERRAL_INPUT}</div>
	                {/if}
	        	</div>                
        <br class="clearfix">
		</div>
    </div>
</div>
<div class="checkout_spacer">&nbsp;</div>
{elseif $box=='addresses'}
<div class="checkout_row">
	<div class="checkout_shipping_address">
    	<div class="checkout_title border_top_radius_6" onclick="slideInOrOut('shipping_address')"><strong>{#title_shipping_address#}</strong> <img id="loader_shipping_address" src="{$tpl_path}img/ajaxload.gif" border="0" class="ajaxloader" width="16" height="16" style="display:none;	vertical-align:middle; position:absolute; margin-left:4px;margin-top:1px;" /> <div class="right" id="btn_shipping_address">-</div></div>
        <div class="checkout_content border_bottom_radius_6" id="chkt_shipping_address">
        	<div id="not_virtual_address"{if $VIRTUAL == 1} style="display:none;"{/if}>
                <div id="shipping_address">{$SHIPPING_ADDRESS_LABEL}</div>
				
                <div id="shipping_address_select" style="display:none;">
					<strong>{#address_old#}</strong><br />
					<span id="dyn_shipping_address"></span><br /><br />
					{if $ADDRESS_NEW_POSSIBLE == 1}
					{$FORM_ACTION_SHIPPING_ADDRESS}
					{$MODULE_new_address}<br />
					<span id="shipping_address_error" class="inputRequirement"></span>
					{$FORM_END}
					{else}
					{#address_no_more#}
					{/if}
                </div>
				
                <div id="shipping_address_button_edit" class="checkout_button">{$BUTTON_EDIT_SHIPPING_ADDRESS}</div>
                <div id="shipping_address_button_save" style="display:none;" class="checkout_button">{$BUTTON_BACK_SHIPPING_ADDRESS}{if $ADDRESS_NEW_POSSIBLE == 1} {$BUTTON_SAVE_SHIPPING_ADDRESS}{/if}</div>
            </div>
            <div id="virtual_address" class="virtual"{if $VIRTUAL != 1} style="display:none;"{/if}>{$TEXT_VIRTUAL}</div>
        <br class="clearfix">
		</div>
    </div>
    <div class="checkout_payment_address">
    	<div class="checkout_title border_top_radius_6" onclick="slideInOrOut('payment_address')"><strong>{#title_payment_address#}</strong> <img id="loader_payment_address" src="{$tpl_path}img/ajaxload.gif" border="0" class="ajaxloader" width="16" height="16" style="display:none;	vertical-align:middle; position:absolute; margin-left:4px;margin-top:1px;" /> <div class="right" id="btn_payment_address">-</div></div>
        <div class="checkout_content border_bottom_radius_6" id="chkt_payment_address">
        	<div id="payment_address">{$PAYMENT_ADDRESS_LABEL}</div>
            <div id="payment_address_select" style="display:none;">
				<strong>{#address_old#}</strong><br />
				<span id="dyn_payment_address"></span><br /><br />
				{if $ADDRESS_NEW_POSSIBLE == 1}
				{$FORM_ACTION_PAYMENT_ADDRESS}
				{$MODULE_new_address}<br />
				<span id="payment_address_error" class="inputRequirement"></span>
				{$FORM_END}
				{else}
				{#address_no_more#}
				{/if}
            </div>
            <div id="payment_address_button_edit" class="checkout_button">{$BUTTON_EDIT_PAYMENT_ADDRESS}</div>
            <div id="payment_address_button_save" style="display:none;" class="checkout_button">{$BUTTON_BACK_PAYMENT_ADDRESS}{if $ADDRESS_NEW_POSSIBLE == 1} {$BUTTON_SAVE_PAYMENT_ADDRESS}{/if}</div>
        <br class="clearfix">
		</div>
    </div>
</div>
<div class="checkout_spacer">&nbsp;</div>

{$FORM_ACTION}
{elseif $box=='comments'}
<div class="checkout_comments">
	<div class="checkout_title border_top_radius_6" onclick="slideInOrOut('comments');"><strong>{#title_comments#}</strong> <div class="right" id="btn_comments">-</div></div>
    <div class="checkout_content border_bottom_radius_6" id="chkt_comments">{$COMMENTS}</div>
</div>
<div class="checkout_spacer">&nbsp;</div>

{elseif $box=='legals'}
{if $AGB_stat == 1}
<div class="checkout_agb">
	<div class="checkout_title border_top_radius_6" onclick="slideInOrOut('agb')"><strong>{#title_agb#}</strong> <div class="right" id="btn_agb">-</div></div>
	<div class="checkout_content border_bottom_radius_6" id="chkt_agb">
        <div>{$AGB}</div>
    </div>
	{if $AGB_CHECKBOX == 'true'}
		<div class="red_agb">{$AGB_checkbox} <strong>{#text_accept_agb#}</strong></div>
	{/if}

</div>
<div class="checkout_spacer">&nbsp;</div>
{/if}

{elseif $box=='wd'}
{if $REVOCATION_stat == 1 and $REVOCATION}
<div class="checkout_revocation">
	<div class="checkout_title border_top_radius_6" onclick="slideInOrOut('revocation')"><strong>{#title_revocation#}</strong> <div class="right" id="btn_revocation">-</div></div>
	<div class="checkout_content border_bottom_radius_6" id="chkt_revocation">
        <div>{$REVOCATION}</div>
    </div>
	{if $REVOCATION_CHECKBOX == 'true'}
		<div class="red_wd">{$REVOCATION_checkbox} <strong>{#text_accept_revocation#}</strong></div>
	{/if}
</div>
<div class="checkout_spacer">&nbsp;</div>
{/if}

{elseif $box=='ds'}
{if $DSG_stat == 1}
<div class="checkout_dsg">
	<div class="checkout_title border_top_radius_6" onclick="slideInOrOut('dsg')"><strong>{#title_dsg#}</strong> <div class="right" id="btn_dsg">-</div></div>
	<div class="checkout_content border_bottom_radius_6" id="chkt_dsg">
        <div>{$DSG}</div>
    </div>
	{if $DSG_CHECKBOX == 'true'}
		<div class="red_ds">{$DSG_checkbox} <strong>{#text_accept_dsg#}</strong></div>
	{/if}

</div>
<div class="checkout_spacer">&nbsp;</div>
{/if}

{/if}
{/foreach}
<div class="checkout_products">
	<div class="checkout_title border_top_radius_6" onclick="slideInOrOut('products')"><strong>{#title_products#}</strong> (<span id="checkout_products_howmuch">{$PRODUCTS_HOW_MUCH}</span>) <img id="loader_products" src="{$tpl_path}img/ajaxload.gif" border="0" class="ajaxloader" width="16" height="16" style="display:none;	vertical-align:middle; position:absolute; margin-left:4px;margin-top:1px;" /> <div class="right" id="btn_products">-</div></div>
    <div class="checkout_content border_bottom_radius_6" id="chkt_products">
        <div id="chkt_products_list">
        {$PRODUCTS_BLOCK}
        </div>
        <div class="checkout_button"></div>
  </div>

</div>

<div class="checkout_spacer">&nbsp;</div>

<div class="checkout_spacer" id="checkout_hiddens">{$HIDDEN_PAYMENT}</div>
<div class="checkout_please_wait" id="checkout_please_wait"></div>
<div class="checkout_error" id="checkout_error_agb"></div>
<div class="checkout_error" id="checkout_error_revocation"></div>
<div class="checkout_error" id="checkout_error_dsg"></div>
<div class="checkout_error" id="checkout_error_payment"></div>
<div class="checkout_error" id="checkout_error_shipping"></div>

<div class="checkout_total" id="checkout_total">
	{$ORDER_TOTAL}<br />
	{$SZI}
</div><br />

<div class="checkout_button_left">{$BUTTON_ORDER_BACK}</div>
<div class="checkout_button">{$HIDDEN_XAJAX}{$BUTTON_ORDER}</div>
<div class="checkout_spacer">&nbsp;</div>

{$FORM_END}
